#ifndef GASSET_MENU_H
#define GASSET_MENU_H
#include <QMainWindow>
#include <QWidget>      //Widget头文件
#include <QPainter>     //画笔头文件
#include <QDebug>       //打印头文件
#include <QMouseEvent>  //鼠标头文件
#include <QWheelEvent>  //滚轮头文件
#include <QTimer>
#include "global_variable.h"
#include "shmh.h"
#include "gascontent_menu.h"

class gasSet_Menu : public QMainWindow
{
    Q_OBJECT
public:
    explicit gasSet_Menu(QWidget *parent = 0);

    QPushButton *theBtn;
    QStringList strList;
    QStringList strList2;
    QStringList strList3;
    QTimer *timer;
    QTimer *timer2;
    QTimer *timer3;//尝试对屏幕双击进行
    QString theStr1[21]={("日期"),("时间"),("O3"),("平均O3"),("光强A"),("光强B"),("流量A"),("流量B"),("压力"),("光池温度"),("灯温度"),("机箱温度"),
   ("----"),("----"),("----"),("----")};
    QString Elec_Gas[6]={"A","B","C","D","E","F"};//存储3种气体分别对应的电磁阀名字

    void SetRange(double min, double max);//设置范围
           int ReadValue();//获取当前值
           void SetValue(int value); //设定当前值
           void mousePressEvent(QMouseEvent *Mouse);   //按下
           void mouseMoveEvent(QMouseEvent *Mouse);    //移动
           void mouseReleaseEvent(QMouseEvent *);      //松开
           void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;             //画图程序
           void paintNum(QPainter &painter, int num, int deviation);//画图程序，调用的，写字程序
//           bool eventFilter(QObject *watched, QEvent *event);
           void keyPressEvent(QKeyEvent *event);
           void choose_OK();//关于OK键按下后的反应
           void rename(QString text);

signals:
    void CurrentValueChanged(int value);

private:
    int Now_Value;//当前值
    int Min_Value;//最小值
    int Man_Value;//最大值
    bool isDragging;//鼠标按下标志位
    int Mouse_Press;//鼠标拖动值
    int Deviation;//显示偏移量
    int flag=1;//表示是否进入循环
    int double_click=0;//双击的计时器

public slots:
};

#endif // GASSET_MENU_H
